﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

using dotUML.Core.Common;

namespace dotUML.Core
{
    /// <summary>
    /// IDiagramEngine provides an interface through which a model
    /// in the form of an XML-file or in the form of a model graph can be processed
    /// </summary>
    public interface IDiagramEngine
    {
        /// <summary>
        /// Errors which occurred while validating or processing xml.
        /// </summary>
        List<IError> Errors
        {
            get;
            set;
        }

        /// <summary>
        /// Checks if a given string is a valid dotUML document
        /// </summary>
        /// <param name="dotUMLDocument">a string containing a dotUML document</param>
        /// <returns>true, if validation was successful. false, otherwise</returns>
        bool Validate(string dotUMLDocument);

        /// <summary>
        /// Renders the diagram given in the dotUML document
        /// </summary>
        /// <param name="dotUMLDocument">a string containing a dotUML document</param>
        /// <returns>List of .jpg files in the form of byte arrays</returns>
        List<byte[]> Process(string dotUMLDocument);

        /// <summary>
        /// Creates an instance of a dotUML model to represent a dotUML document in memory
        /// </summary>
        /// <returns>dotUML model via IModel interface</returns>
        IModel GetModel();
    }
}
